package cn.com.shopec.erp.purchase.service;

import java.util.List;

import cn.com.shopec.erp.common.page.PageFinder;
import cn.com.shopec.erp.common.page.PageQuery;
import cn.com.shopec.erp.product.vo.DefectiveVo;
import cn.com.shopec.erp.purchase.entity.PurchaseOrder;
import cn.com.shopec.erp.purchase.entity.PurchaseRequisitionProduct;
import cn.com.shopec.erp.purchase.entity.PurchaseReturnOrder;
import cn.com.shopec.erp.purchase.model.PoProductInfo;
import cn.com.shopec.erp.purchase.model.PurchaseOrderDetail;
import cn.com.shopec.erp.purchase.model.PurchaseOrderInfo;
import cn.com.shopec.erp.purchase.model.PurchaseOrderQuery;
import cn.com.shopec.erp.purchase.vo.PurchaseOrderVo;
import cn.com.shopec.erp.purchase.vo.PurchaseRequisitionProductVo;
import cn.com.shopec.erp.purchase.vo.PurchaseReturnOrderVo;

/** 
 * @ClassName: IPurchaseOrderService 
 * @Description: 采购单业务service接口
 * @author: lule
 * @date 2013-5-22 上午11:05:50
 *  
 */

public interface IPurchaseReturnOrderService {
	
	/** 
	 * @Title: getPagedPurchaseOrders 
	 * @Description: 根据查询条件，查采购单
	 * @param query  
	 * @param pageQuery
	 * @return  
	 * @throws 
	 * @author: lule
	 * @date: 2013-5-23上午10:02:35
	 */
	public PageFinder<PurchaseOrderInfo> getPagedPurchaseOrders(PurchaseOrderQuery query, PageQuery pageQuery);
	
	/**
     * 
     * @Title: getPagedPurchaseOrderList
     * @Description: 分页查询采购信息
     * @param PurchaseOrderVo
     * @param pageQuery
     * @return
     * @throws
     * @author: LiangShunWang
     * @date: 2016-11-21下午16:52:05
     */
	 public PageFinder<PurchaseReturnOrderVo> getPagedPurchaseOrderList(PurchaseReturnOrderVo purchaseOrderVo, PageQuery pageQuery)throws Exception;
	 
	/**
     * 
     * @Title: getBrand
     * @Description: 根据编号查询采购单退货信息信息
     * @param productId
     * @throws Exception
     * @throws
     * @author: LiangShunWang
     * @date: 2013-5-26下午05:02:06
     */
    public PurchaseReturnOrderVo getPurchaseOrder(String puNo);
    
    /**
     * 
     * @Title: getBrand
     * @Description: 根据货品编号和采购单查询信息
     * @param productId
     * @throws Exception
     * @throws
     * @author: LiangShunWang
     * @date: 2013-5-26下午05:02:06
     */
    public PurchaseReturnOrder getPuNoByPurchaseRequest(String puNo,String prodNo);
    
    public PageFinder<PurchaseReturnOrder> getPuNoByPurchaseRequestQuery(String puNo,String prodNo,PageQuery pageQuery);
    
    /**
     * 
     * @Title: updateBrand
     * @Description: 修改次品信息
     * @param brandVo
     * @return
     * @throws
     * @author: duhui
     * @date: 2013-5-26下午04:17:40
     */
    public void updatePurchaseOrder(PurchaseOrderVo purchaseOrderVo) throws Exception;
    
    /**
     * 
     * @Title: addPurchase
     * @Description: 增加采购退换货信息
     * @param brandVo
     * @return
     * @throws
     * @author: Liangshunwang
     * @date: 2013-5-26下午04:17:40
     */
    public void addPurchaseReturn(List<PurchaseRequisitionProductVo> purchase,PurchaseReturnOrderVo purchaseReturnOrderVo) throws Exception;

    /**
     * 
     * @Title: deletePurchase
     * @Description: 删除采购信息
     * @param brandVo
     * @return
     * @throws
     * @author: Liangshunwang
     * @date: 2013-5-26下午04:17:40
     */
    public boolean deletePurchase(String pono) throws Exception;
    
    /**
	 * @methodName：addPurchaseRequisitionVo
	 * @Description: 添加请购单
	 * @param PurchaseRequisitionVo
	 * @return ModelMap
	 * @author: gaoyaxiong
	 * @date: 2013-5-21 下午18:22:03
	 */
	public String addPurchaseRequisitionVo(PurchaseOrderVo prv);
	
	/** 
	 * @Title: isModifiablePo 
	 * @Description: 判断一个采购单是否是可以修改的
	 * @param po
	 * @return  
	 * @throws 
	 * @author: lule
	 * @date: 2013-5-27下午5:18:56
	 */
	public boolean isModifiablePo(PurchaseOrderInfo po);
	
	/** 
	 * @Title: getPurchaseOrderDetail 
	 * @Description: 根据采购单号，获取采购单明细
	 * @param poNo
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: lule
	 * @date: 2013-5-27下午2:31:28
	 */
	public PurchaseOrderDetail getPurchaseOrderDetail(String poNo) throws Exception;
	
	/** 
	 * @Title: getPagedPoProducts 
	 * @Description: 根据采购单号，查询采购单相关的商品信息
	 * @param poNo
	 * @param pageQuery
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: lule
	 * @date: 2013-5-27上午10:09:46
	 */
	public PageFinder<PoProductInfo> getPagedPoProducts(String poNo, PageQuery pageQuery) throws Exception;
	public PageFinder<PurchaseRequisitionProductVo> getPagedPoProducts2(String poNo, PageQuery pageQuery) throws Exception;
	
	public PageFinder<PurchaseRequisitionProductVo> getPoNoByPurchaseRequest(String poNo,String prodNo ,PageQuery pageQuery) throws Exception;
	
	/** 
	 * @Title: updatePurchaseOrderByAudit 
	 * @Description: 采购主管审核
	 * @param poNo
	 * @param pageQuery
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: Liang shun wang
	 * @date: 2013-5-27上午10:09:46
	 */
	public void updatePurchaseOrderByAudit(PurchaseReturnOrderVo purchaseVo) throws Exception;
	
	/** 
	 * @Title: getPurchaseOrderPriceAmount 
	 * @Description: 判断审核金额是否达到要求
	 * @param poNo
	 * @param pageQuery
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: Liang shun wang
	 * @date: 2013-5-27上午10:09:46
	 */
	public double getPurchaseOrderPriceAmount(String prNo) throws Exception;
	
	/** 
	 * @Title: getPoProduct 
	 * @Description: 根据采购单号和货品号，取得一个采购单货品信息
	 * @param poNo
	 * @param prodNo
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: Liang Shun wang
	 * @date: 2013-5-27下午5:35:17
	 */
	public PoProductInfo getPoProduct(String poNo, String prodNo) throws Exception;
	
	/** 
	 * @Title: updatePoProductPriceAndQuantity 
	 * @Description: 更新采购单中某个货品的采购单价和采购数量
	 * @param poNo
	 * @param prodNo
	 * @param unitPrice
	 * @param quantity
	 * @return 操作结果代码。(1:成功、0:失败、 -1:失败，参数采购单编号不正确、 -2:失败，当前采购单不能作废、-3:失败，参数采购单号或货品号不正确)
	 * @throws Exception  
	 * @throws 
	 * @author: lule
	 * @date: 2013-5-24下午9:35:26
	 */
	public int updatePoProductPriceAndQuantity(String poNo, String prodNo, double unitPrice, int quantity) throws Exception;
	
	/** 
	 * @Title: updatePoProductPriceAndQuantity 
	 * @Description:根据采购单号查询采购单名称
	 * @param poNo
	 * @throws Exception  
	 * @throws 
	 * @author: Liang Shun Wang
	 * @date: 2013-5-24下午9:35:26
	 */
	public PageFinder<PurchaseReturnOrderVo> getPurchaseOrderById(String puNo,PageQuery pageQuery) throws Exception;
	
	/** 
	 * @Title: updateAuditResultPurchaseOrder 
	 * @Description:出库后修改采购单状态为采购已出库
	 * @param poNo
	 * @throws Exception  
	 * @throws 
	 * @author: Liang Shun Wang
	 * @date: 2013-5-24下午9:35:26
	 */
	public void updateAuditResultPurchaseOrder(String purchaseNo,int status) throws Exception;
	
	/** 
	 * @Title: updatePurchaseOrderByAudit 
	 * @Description: 采购
	 * @param poNo
	 * @param pageQuery
	 * @return
	 * @throws Exception  
	 * @throws 
	 * @author: Liang shun wang
	 * @date: 2013-5-27上午10:09:46
	 */
	public void purchaseOrderList(String poNo) throws Exception;
	
	

}



